package com.mxpio.erp.common.workshop.entity;

import com.mxpio.erp.common.technology.entity.WorkShop;
import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Data
@Entity
@Table(name = "v_mb_erp_workshop_mo_execute_sum")
@Schema(description="各车间生产订单执行情况(统计当月)")//统计生产当月(计划完成时间)执行情况，按车间汇总
public class VMOExecuteSum implements DictAble, Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Transient
	private Map<String, String> textMap;

	public String putText(String key, String value) {
		if (textMap == null) {
			textMap = new HashMap<>();
		}
		return textMap.put(key, value);
	}
	@Id
	@Column(name = "MAIN_WORKSHOP_")
	@Schema(description = "车间")
	@Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
	private String mainWorkshop;

	@Column(name = "DOINGCNT_")
	@Schema(description = "执行中订单数量")
	private BigDecimal doingCnt;

	@Column(name = "ONTIMECNT_")
	@Schema(description = "准时完成订单数量")
	private BigDecimal ontimeCnt;

	@Column(name = "DELAYCNT_")
	@Schema(description = "延期订单数量")
	private BigDecimal delayCnt;

}
